package com.hicorp.segment.controller;

import com.hicorp.segment.pojo.query.QueryBy;
import com.hicorp.segment.service.QueryService;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/query/{tableName}")
public class QueryController {
    private final QueryService queryService;

    public QueryController(QueryService queryService) {
        this.queryService = queryService;
    }


    // 组合搜索
    @PostMapping("/search")
    public Object queryBy(@PathVariable String tableName, @RequestBody QueryBy queryBy) {
       return queryService.queryBy(tableName, queryBy);
    }
}
